//
//  LogisticsInfoCell.m
//  PPDL
//
//  Created by 王洋 on 2019/8/8.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "LogisticsInfoCell.h"

@implementation LogisticsInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


- (void)fillCellWithModel:(LogistcsModel *)model {
    
    
    self.logisticsStatusLab.text = model.logisticsStatus;
    self.logisticsTimeLab.text = model.logisticsTime;
    
    if (model.isLatest && !model.isOldest) {  //第一个
        
        self.itemTopLine.hidden = YES;
        self.itemBottomLine.hidden = NO;
        [self.leadIcon setImage:[UIImage imageNamed:@"wuliu_weizhi"]];
        self.logisticsStatusLab.textColor = PP_Default_Color_Red_FF3737;
        self.logisticsTimeLab.textColor = PP_Default_Color_Red_FF3737;
        
    }
    
    if (!model.isLatest && model.isOldest) {  //最后一个
        
        self.itemTopLine.hidden = NO;
        self.itemBottomLine.hidden = YES;
        [self.leadIcon setImage:[UIImage imageNamed:@"empty_gray"]];
        self.logisticsStatusLab.textColor = PP_Default_Color_Black_333333;
        self.logisticsTimeLab.textColor = PP_Default_Color_Black_333333;

    }
    
    if (!model.isLatest && !model.isOldest) {  //只有t一条
        
        self.itemTopLine.hidden = YES;
        self.itemBottomLine.hidden = YES;
        [self.leadIcon setImage:[UIImage imageNamed:@"wuliu_weizhi"]];
        self.logisticsStatusLab.textColor = PP_Default_Color_Red_FF3737;
        self.logisticsTimeLab.textColor = PP_Default_Color_Red_FF3737;
    }
    
    if (model.isMiddle) {
        self.itemTopLine.hidden = NO;
        self.itemBottomLine.hidden = NO;
        [self.leadIcon setImage:[UIImage imageNamed:@"empty_gray"]];
        self.logisticsStatusLab.textColor = PP_Default_Color_Black_333333;
        self.logisticsTimeLab.textColor = PP_Default_Color_Black_333333;
    }
}


@end
